

import task from "../../../models/dict/task.js"  //任务字典模块
import clType from "../../../models/dict/clothesSizeType"  //任务字典模块
import array from "../../../models/comm/array.js"  //数组操作模块
import py from '../../../models/comm/webPy';
import axios from 'axios';
import Vue from 'vue'
export default {


    data: function () {


        return {
            taskClassArray: task.classArray(),
            newColor: "",
            showAddColor: false,
            showChangeSize: false








        }
    },
    props: {

        currObj: {},
        dataType: {}

    },
    methods: {
        getAllSize() {
            return clType.sizeArray()
        },

        getSizeName(sizeId) {
            return clType.getSizeName(sizeId)
        },

        RemoveColor(index, ar) {
            ar.splice(index, 1);
            this.sizeChange()

        },
        sizeChange() {




            Vue.set(this.currObj, this.dataType, clType.formatData(this.currObj[this.dataType]))


        },
        addNewColor() {


            this.currObj[this.dataType].data.push({

                colorName: this.newColor,
                sizeArray: []
            });
            this.sizeChange()


            this.showAddColor = false

        },
        getUnitName: function (unitId) {
         
            var unitName = clType.getUnitName(unitId);
            return unitName
        }






    },
    mounted() {


    },
    watch: {



    }



}